﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EnvDTE80;
using System.IO;
using System.Diagnostics;


namespace bleissem.CMWVS_Plugin_VS2010
{
    public class BuildCompileParameters
    {

        public static void Build(EnvDTE.Solution solution, TraceListener listener, out CMWVS.Core.Commands.CompileCommandParamater parameter)
        {
            if ( (null == solution) || (string.IsNullOrWhiteSpace(solution.FullName)))
            {
                parameter = new CMWVS.Core.Commands.CompileCommandParamater();
                return;
            }


            CMWVS.Core.Commands.CompileCommandParamater result = new CMWVS.Core.Commands.CompileCommandParamater(new CMWVS.Core.Projects.Solution(new FileInfo(solution.FullName)), listener);
            
            parameter = result;
        }

        public static void Build(EnvDTE.Solution solution, TraceListener listener, out CMWVS.Core.Commands.RebuildCommandParameters parameter)
        {
            if ((null == solution) || (string.IsNullOrWhiteSpace(solution.FullName)))
            {
                parameter = new CMWVS.Core.Commands.RebuildCommandParameters();
                return;
            }


            CMWVS.Core.Commands.RebuildCommandParameters result = new CMWVS.Core.Commands.RebuildCommandParameters(new CMWVS.Core.Projects.Solution(new FileInfo(solution.FullName)), listener);

            parameter = result;
        }

        public static void Build(EnvDTE.Solution solution, TraceListener listener, out CMWVS.Core.Commands.CleanCommandParameters parameter)
        {
            if ((null == solution) || (string.IsNullOrWhiteSpace(solution.FullName)))
            {
                parameter = new CMWVS.Core.Commands.CleanCommandParameters();
                return;
            }


            CMWVS.Core.Commands.CleanCommandParameters result = new CMWVS.Core.Commands.CleanCommandParameters(new CMWVS.Core.Projects.Solution(new FileInfo(solution.FullName)), listener);

            parameter = result;
        }
    }
}
